
D_ARMV7L_BASEAPI_FLAGS= \
	-DOS_LINUX_SOC \
	-D__STDC_FORMAT_MACROS 
D_ARMV7L_LIBMSLOG_LIBS 	:=`pkg-config --libs	libmslog_armv7l`
D_ARMV7L_LIBMSLOG_INCLUDES 	:=`pkg-config --cflags	libmslog_armv7l`
D_ARMV7L_LIBMSCOMMON_LIBS 	:=`pkg-config --libs	libmscommon_armv7l`
D_ARMV7L_LIBMSCOMMON_INCLUDES 	:=`pkg-config --cflags	libmscommon_armv7l`
D_ARMV7L_LIBPROTOCOL_LIBS 	:=`pkg-config --libs	libmsprotocol_armv7l`
D_ARMV7L_LIBPROTOCOL_INCLUDES 	:=`pkg-config --cflags	libmsprotocol_armv7l`

C_ARMV7L_INCLUDE	:=${D_AARMV7L_LIBMSLOG_INCLUDES} ${D_ARMV7L_LIBMSCOMMON_INCLUDES}  ${D_ARMV7L_BASEAPI_FLAGS} -Isrc 
C_ARMV7L_LIBS		:=${D_AARMV7L_LIBMSLOG_LIBS}     ${D_ARMV7L_LIBMSCOMMON_LIBS} -pthread -lm  
libmsprotocol_armv7l_PATH=/home/sugao/H2_toolchain/toolchain/4.9.3
libmsprotocol_armv7l_CC=${libmsprotocol_armv7l_PATH}/bin/arm-cortexa9-linux-gnueabihf-gcc
libmsprotocol_armv7l_SRC=${C_SRC}
libmsprotocol_armv7l_CFLAGS=${C_ARMV7L_INCLUDE} ${C_ARMV7L_LIBS} ${CFLAGS_SHARE} -fPIC

armv7l:libmsprotocol_armv7l install_armv7l

libmsprotocol_armv7l: 
	mkdir -p $(OUT_LIB)
	mkdir -p $(OUT_INCLUDE)
	cp -fr src/*.h $(OUT_INCLUDE)
	$($@_CC)  $($@_SRC)  $($@_CFLAGS)  -o $(OUT_LIB)/$(PROGRAM_NAME).so 

install_armv7l: 
	mkdir -p  ${prefix_armv7l}/lib/ 
	mkdir -p  ${prefix_armv7l}/include/   
	mkdir -p  ${prefix_armv7l}/lib/pkgconfig/ 
	cp    -fr $(OUT_LIB)/$(PROGRAM_NAME).so	${prefix_armv7l}/lib/     
	cp    -fr $(OUT_INCLUDE)			${prefix_armv7l}/include/	     
	cp    -fr platform/$(PROGRAM_NAME)_armv7l.pc	${prefix_armv7l}/lib/pkgconfig/

uninstall_armv7l:
	rm -fr ${prefix_armv7l}/lib/$(PROGRAM_NAME).so 
	rm -fr ${prefix_armv7l}/include/$(PROGRAM_NAME)
	rm -fr ${prefix_armv7l}/lib/pkgconfig/$(PROGRAM_NAME)_armv7l.pc
	rm -fr ${prefix_armv7l}/bin/mscore_mctu
